import React, { useState } from "react";
import videoObject from "../../assets/video/1.mp4";

const VideoObject = () => {
  const [isShowVideo, setIsShowVideo] = useState(false);

  return (
    <div>
      <div>
      <button onClick={() => {
        setIsShowVideo(!isShowVideo);
      }}>切换是否打开视频</button>
      </div>
      <div
        style={{
          width: "1000px",
          height: "1000px",
        }}
      >
      {
        isShowVideo && <video style={{
          width: "100%",
        }} src={videoObject} controls></video>
      }
      </div>
    </div>
  )
}

export default VideoObject;
